package com.qf;

import com.github.pagehelper.PageInfo;
import com.qf.entity.Student;
import com.qf.service.AccountService;
import com.qf.service.StudentService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.text.ParseException;
import java.util.List;

public class MainApp {
    public static void main(String[] args) throws ParseException {
        ApplicationContext ioc = new ClassPathXmlApplicationContext("application-anno.xml");

        StudentService studentService = ioc.getBean(StudentService.class);

        PageInfo<Student> pageInfo = studentService.findByPage(2, 2);
        List<Student> list = pageInfo.getList();
        for (Student student : list) {
            System.out.println(student);
        }
//
//        List<Student> studentList = studentService.findAll();
//
//        for (Student student : studentList) {
//            System.out.println(student);
//        }

//        AccountService accountService = ioc.getBean(AccountService.class);
//
//        accountService.transfer(1,2,100d);

    }
}
